package com.thor.palmmall.rest.order;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.thor.commons.entity.BeanOperateInfo;
import com.thor.commons.exception.ThorServiceException;
import com.thor.commons.query.QueryResult;

/**
 * 
 * 定单相关接口
 * 
 * @author vergar
 * 
 */
@Path("/moonstar/order")
@Produces(MediaType.APPLICATION_JSON + "; charset=utf-8")
@Consumes(MediaType.APPLICATION_JSON + "; charset=utf-8")
public interface AOrderService {
	
	
	/**
	 * 保存订单
	 * @param condition
	 * @return
	 * @throws ThorServiceException
	 */
	@POST
	@Path("/save")
	String saveOrder(AOrder order,@QueryParam("") BeanOperateInfo operateInfo) throws ThorServiceException;
	
	/**
	 * 获取订单
	 * @param condition
	 * @return
	 * @throws ThorServiceException
	 */
	@GET
	@Path("/{id}")
	AOrder get(@PathParam("id") String id) throws ThorServiceException;
	
	@PUT
	@Path("/abort")
	String abort(@QueryParam("id") String id,@QueryParam("version") long version,
			@QueryParam("")  BeanOperateInfo operateInfo) throws ThorServiceException;

	@POST
	@Path("/query")
	QueryResult<AOrder> query(AOrderCondition condition) throws ThorServiceException;
}
